home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include "win32.h"
-
- int doit(int ix);
-
- int main(int argc, char **argv)
- {
-
- int ix;
-
- for (ix=0; ix < 8 * 1024; ix++)
- {
- doit(ix);
- }
-
- fflush(stdout);
-
- return 0;
- }
-
- int doit(int ix)
- {
- char buff[128];
- char* cp;
-
- itoa(ix,buff,10);
- SetEnvironmentVariable("COUNT", buff);
- GetEnvironmentVariable("COUNT", buff, 128);
-
- cp = malloc(strlen(buff)+1);
- if (cp)
- {
- strcpy(cp,buff);
- printf("COUNT=%s\n",cp);
- free(cp);
- }
- else
- printf("MEMORY ERROR\n");
-
- return 0;
- }
-